error handling documentation added