Fixed bug with nullpointers in workhandler