fixed category logic bugs