Avoid potential nil undefined method error