and fixed bug introduced by last commit