some db related functions added to gt.pl