added missing guard clauses