For some reason gorm not working correctly so add fix to stop credit being updated twice