Replaced data JSON regex with try/catch
Fixed data buffer position