added logging in input validation