Fixed a bug that incorrect returned value from method