Modified checking the connection. Still not working :\.