add insert&select for db. some fixes...