Hardware events selector keep throwing error

Thanks for this @rohith.prabhu I really appreciate the help ! This one is the solution that I tried and so far I receive no error. Thank you very much !