save to database and ignore null data