works without crashing now