fixed bug described before