added waitfor to process execution