js fix for .first, not perfect