BT: implemented working insert query