created test and fixed bug for #279