made daemon port configurable and added a timeout to the daemon process