Refactored code so that the Result is now returned in the proper way.