fixed async executions by refactoring promise functions