Fix improper dropdown closing