check for Nil before running sub