test timeout function