fixing a bug in detached criteria