fixed bug in JSON structure sent to rails