fixed JSON errors, security issue and double array from library