Bugfix, undefined index line 47