fix bug in repository / query