working in firefox, failing in chrome