Fixed the rezise function