resolve wasn't binding function to the correct context