Fixed a critical bug that crashes by invoking method