Tested and fixed a bug