Fix fatal error caused by using wrong object