Add timeout and close when click outside