updated realm management with uri validation. fixed missing javascript variable is_sandbox.