It's better to use ?TIMEOUT instead of 5000 here in my opinion.