Trying to correct nil problem