fixing undefined var, thanks to @liquorandbeer on #10