Fixes error that occured when passing nil to the initialize method