dynamic page javascript error fixed