fixed wrong lookup value in save function