Added guard clauses to prevent wrong usage