added functionality to close menu after selecting of item