correct listen function, which updates the given listen port if the port is already used