Issues/275 undefined var

Fix for issue 275