fix coverage inject function's bugs