refactor code && fix javascript eror