Maybe the function should have an error return instead of returning an "error string"