Added logic for checking whether server is up or not