Added error check to test server listener