improved signals handling