Fixing null pointer on record Online