Fixing undefined property issue.