add a check function and maybe it's correct