fix function resize