fixed reference error and indentation