Added onEmpty support to the DrawElement replace option