Fixing calling promises functions

Just fixing some problems on calling functions and returning values