removed deprecated split(), fixed undef warning