fixed some bugs and added a crash!(you can report it if you like)