creating error listeners