Updated errors handling