added config file and fix code for php 5.3