Updated err variable instead of null.