fixed query in inventory edit