fixed bug in capitalize function