debuged so PORTNUM is convert to integer