add const cast

add const for some casts.