added default function in php and js