bug fix
resolve merge conflict
Added more codes