fixed an utterly stupid bug
a little bit clean up