add guard clauses