changed coding style
added support for both sync and async calls