changed to handle callback order
merged against Issue 39