all error handleing changes