wait for execution to end