Adding changes from html version, shared db