fix php notices on functions