Add proper error messages rather than returning out of functions