Add category function and fix bug on show