fixed case where ip is nil in app.rb