working before async refactor