had to add a type-casting line to cleanbodyjson(dirty) to escape TypeError: Object #<Object> has no method search