Nil check for cost, logging method