errors handling implemented