Correction - now working version, previously wasn't saving to db