removed duplicate code from the last merge