Add in extra check before dereference