system call : wait has to be done first