fix resize function to send error only if both dimensions are not specified