added stated with path js; error messages handling