fixing port and error reporting