fix trailing slash redirect bug and add user authentication when saving a previous program