fixed bug when user clicked on more than one element