changed script function
added functionality to check server status