Handle selectors by class
inArray function bug with the index fixed