usage of wait()