cut duplicate of function

fixed #571