several bugfixes
fixed typebug