add error check
4-4 init
4-4 implement
minor change