works but with javascript errors