Callbacks added to fix async problems.