Updated mine saving to use the database - Untested