add check for working php functions and minor changes