merged and fixed