refractoring bootstrap dropdown error