added few bugfixes