added coding to datahandler