Fix for the null exception