fix for access violation in select