fixed warning about undeclared variable
fixed php warning
fixed php warnings