BugFix #5

Fixed bug caused by nil variable.