Added more code to handle the workers