add port number configuration
add port number configuration and fix a bug with resources