Fix notebook should not be sent to flask if invalid type