use COALESCE in place of CASE