added asynch support (initial version)