bugfixed and improvements for controller returning when dealing with async functions