Coded save function for user.js