bug fixes, everything is now working