replaced deprecated split with explode