fixed query in create view