added method to convert result in a hash provided a key is passed