some bug fixes for worker