Added input protection to prevent physical damamge