send null if undefined; comments + credit of idea