fix errors due to wrongs inputs