fixes nil-class location bug