fixing type bugs
merge