hadling the errorsn