added errors handle