fix for resize bug