First attempt att fixing js bug for chrome