update gemfile
refactored mode check and orgid lookup