Adding a close icon as well as clickout function