some tweaks, everything seems to work