fix convert logic