fix bash function