Feature/fix codecasting

This fixes codecasting for edit mode