bug fix, only insert values which exist