Fixed

fixed the error with null references