Remove unused function causing errors