added some casts to const