fixed a few bugs ;)