you need to check that code is not null