js fix for card page bug