fixed a few crashes. Added ID stuff for testing