modified file to handle tbpref properly