automatic starting and ending of procces