Receiving data without crashing