Fixed error 803

Added check for broken conncections so error 803 is not triggered before
error 827.