bug fixes: to_date condition and lowcase column