Added checks to inputs