Fixed buggy php