now works properly with asynchronous callbacks...