change returning data format to a hash. fixed #2