finish hash builder and hash upgrade functions