php files+ some bug fix