fixing some constness issues