bug with existst() function fixed, function removed