fixed a small categories bug and condensed view logic code