uri.trimFragment() was missing and caused error