added port input protection against characters, closes #2