create drophandler function