better logic
small bugfix