fixes incorrect use of instancetype