fixed bug in main view regarding click events