improve error handling
add messages