Modified handling of mongodb port