Fix dropdown not closing on document click