fix bug which caused app crash, fix #4