added errors as global