Fix code for php 5.4