Removed 'undefined' and replaced with '0'