fix package function