Now saving the correct values. Don't know if is the best way.