change returned type to int to match port.