fix array size problem for optional classes