fixed identation, added an error message