check if returned cost is not None