Added conditionals for browser alerts