Fixed parsing error and switched to php