use setTimeout for calling callback here, as the normal path is asynchronous.