fix general function bug