Moved input type check to the correct place. Starting to get late now ;)