bugfix to  handling