modify according to comments and add test case for joblogger