*fix query and delete