Fixing null exception