Added guard for inputs