changed worker function to method
add handling panic
be able to returns error
improve worker's servability