fixing the null exception.