bugfixes and correct scope added to console
main updated