#555 fix all bugs