added condition to add 'active' class to items