Moved if_object_exists call after profiling