replace NOT IN with NOT EXISTS

The NOT IN query did not work for me for some reasons. The NOT EXISTS method seems better here and now it works for me.