Reformatted and better error avoidance