Fixed issue pointing to undefined object