Category select bugfix

wrong query generated