Javascript fix open event not fired