tested and fixed