Added errors handling.