Edit port, Add error logging