handle invalid connections