better handle inputs