Small security fix + removed unused function