better error handling & test in multiple browsers