fixing nil issues