added implicit type casting on insert with subselect