fixing bugs. added setIfNotNull