fix it, but not sure about the performance