bugfixes and some new stuffs