fixing error thrown in chrome when using angular