guard against negative numbers