modified some code for removing some warning