properly handle missing headers
start handling errors