removed duplicate code(to prev)