fixed js issue thanks to Marius