change code to avoid strange a bug in PHP