fixed problem with select in transactions