removed some unsafe calls