fixes json encode for < php 5.4