normalise error handling
add db script