added functionality to tell difference between no connection and incorrect data