Fixed type error which caused crash