Removed onerror handler

removed server:close switch case