fix issue when running in angular js