Fixed resize bug