refactoring
fix js console error