try catch for razor password