add some functions from precheck