fixed error messages and cross browser issues