better error guards