use signals instead of sleeps