Some changes to handle php 5.4 warning message

If some one use current version to run in php 5.4, it will show warning message.
This commit to handle the undeclared variable that makes the message