added presence and type validation