Fixing getCreationQuery method