Working on fixing resolve function.