Use correct object type variable

This fixes the issue where creation buttons don't work.