Added logging to worker and fixed overflow